home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / TGCBOR20.ARJ / INTROPAK.COM / TWWSAM.C < prev   
Text File  |  1991-04-25  |  1KB  |  70 lines

  1.  
  2.   /* -- a simple window with a world coordinate system, the items are  */
  3.   /* -- redraw and fitted to the window when it is resized.  */
  4.  
  5. #include "teglsys.h"
  6.  
  7. #ifdef WCFLOATLINT
  8.  
  9. unsigned  worldredraw(imagestkptr  ifs, msclickptr   ms)
  10.   { winframeptr  wf;
  11.  
  12.     wf = findwinframe(ifs);
  13.     twwdefineworld(wf,-10000,10000,10000,-10000);
  14.     twwline(wf,-10000,-10000,10000,10000);
  15.     twwrectangle(wf,-5000,-5000,5000,5000);
  16.     setfillstyle(SOLID_FILL,BLUE);
  17.     twwbar(wf,-9000,9000,-5000,5000);
  18.     twwarc(wf,0,0,180,360,5000);
  19.     twwellipse(wf,0,0,180,360,4000,4000);
  20.     twwcircle(wf,0,0,6000);
  21.     return 0;
  22.   }
  23.  
  24.  
  25. #else
  26.  
  27.  
  28. unsigned  worldredraw(imagestkptr  ifs, msclickptr   ms)
  29.   { winframeptr  wf;
  30.  
  31.     wf = findwinframe(ifs);
  32.     twwdefineworld(wf,-10.0,10.0,10.0,-10.0);
  33.     twwline(wf,-10.0,-10.0,10.0,10.0);
  34.     twwrectangle(wf,-5,-5,5,5);
  35.     setfillstyle(SOLID_FILL,BLUE);
  36.     twwbar(wf,-9,9,-5,5);
  37.     twwarc(wf,0,0,360,180,5.0);
  38.     twwellipse(wf,0,0,180,360,4.0,4.0);
  39.     twwcircle(wf,0,0,6.0);
  40.     return 0;
  41.   }
  42.  
  43. #endif
  44.  
  45. winframeptr  wf;
  46.  
  47.  
  48. void main(int argc, char **argv)
  49. {
  50.  
  51.  
  52.   tweasystart();
  53.  
  54.   setautorotate(TRUE);
  55.   setteglfont(font14);
  56.     /* --------- */
  57.   twinit(&wf,100,100,400,300);
  58.   twsetthickness(wf,6);
  59.   twsetwinframecolors(wf,LIGHTGRAY,DARKGRAY);
  60.   twsetheader(wf,"World Window");
  61.   twsetredraw(wf,worldredraw);
  62.   twdrawwindowframe(wf);
  63.  
  64.   setautorotate(TRUE);
  65.   teglsupervisor();
  66. }
  67.  
  68.  
  69.  
  70.